/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package model;

import java.sql.ResultSet;
import java.sql.Statement;
import java.util.ArrayList;
import java.util.List;
import model.entity.Branch;


public class BranchImp {
    public List<Branch> Branchs()
    {
        List<Branch> lbr = new ArrayList<Branch>();
        try {
            Statement st = ConnectDatabase.getConnection().createStatement();
            ResultSet rs = st.executeQuery("select * from branch");
            while(rs.next())
            {
                lbr.add(new Branch(rs.getInt("branchid"), rs.getString("branchname"), rs.getString("country"), rs.getString("city"), rs.getString("state_province"), rs.getString("street")));
            }
        } catch (Exception e) {
            lbr = null;
        }
        return lbr;
    }
}
